var express = require('express');
var router = express.Router();


var auth = function (req, res, next) {
	var cert = req.cert;
	if (!cert || cert.type === 'anonymous') {
		res.render('system/login');
	} else {
        next();
	}
};

/* GET home page. */
router.get('/', auth, function (req, res, next) {

	res.render('system/index', {
		menus : req.menus,
		title : '管理平台'
	});
});

module.exports = router;
